|
LotusScript library: LSALibOFMgr |
| Global variables |
Public NewObj_Factory = Variant Private FactorieS List = Variant
|
Allows the dynamic loading of script libraries and their associated classes.
The advantage of this is
- Only the libraries actually used are loaded,
- No circular references any more.
On the downside class and library have to have the same name,we need to use
variants and lose the ability for strong checking and we have to standardize on
constructors without any parameters. Both aspects are small compared to the gains.
The idea is to create and execute a little script, that contains the use statement
for the requested class and instanciates the factory class associated with it. The
factory class has the ability to 'produce' an instance of the class. In order to do that
we need to standardize the constructors, such that they do nothave parameters any
more. We also have to assume, that there is an associated factory class .
Existing factory classes are kept for later usage in the factories list.
Example:
instead o directly creating a class like
use "LibMyClass"
Dim MyInstance as MyClass
Set MyInstance = New Myclass("valx")
:
we use the Object facory managers function
use "LSALibOFMgr"
Dim MyInstance as variant
Set MyInstance = NewObj ("Myclass")
MyInstance.AttribX = "valx"v
OFMgr is a base functionality that needs no prerequisites nor configuration.
- Author:
-
LPS EMEA
- Version:
-
2.0.0 28.MAR.2000
- History:
| 28.MAR.2000 | ESc | Reworked for docu standards
|
| Method Summary |
Function NewObj (ClassName As String) As Variant |
NewObj
Public Function NewObj(ClassName As String) As Variant
Returns an instance of the requested class. Let the classnamebe "MyClass" and we would
try to use "LSALibMyClass"followed by "MyClass". Once found, it produces a factory instance
for the class, which in turn allows to produce the final instance. This is why the library always
needs a factory associated with it, in our case
Class Myclass
:
End Class
Class MyclassFactory
:
Function produce as variant
set produce as new MyClass()
End function
End Class
- Parameters:
| ClassName | String | representing the library and the class name!
|
- Returns:
| Variant | a new object of class x
|
| Top | LotusScript Doc |
| © Lotus Professional Services |
| generated on : 05-Apr-01 10:01:44 AM |